<template>
  <div>
     <div>姓: <input type="text" v-model="firstName"> </div>
     <div>名:<input type="text" v-model="lastName"></div>
     <div>姓名:<input type="text" v-model="fullName"></div>
  </div>
</template>

<script>
export default {
  data(){
    return {
      firstName:'张',
      lastName:'三丰'
    }
  },
  computed:{
    fullName:{
      get(){
        return this.firstName+" "+this.lastName
      },
      set(newval){
         this.firstName=newval.split(" ")[0]
         this.lastName=newval.split(" ")[1]
      }
    }
  }
}
</script>

<style>

</style>